home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_aet_doormove2.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  188 lines

  1. # Jones 3D Cog Script
  2. #
  3. # aet_DoorMove2.cog
  4. #
  5. # [TL]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. #
  9. # ========================================================================================
  10. symbols
  11.  
  12. message        startup
  13. message        arrived
  14. message        activated
  15. message        user0
  16.  
  17. thing        player                            local
  18. thing        indy0                                    # Indy actor 1.
  19. thing        door0                                    # Door.
  20. thing        button0                                                                
  21.  
  22. thing        cam0                                    # Camera 1.
  23. thing        cam0_target                                # Camera 1 target.
  24.  
  25. surface        deathAdjoin
  26.  
  27. int            done0=0                            local    # Flag for when door is done opening.
  28. int            done1=0                            local    # Flag for when wrong whip is done being used.
  29.  
  30. vector        v_camspot                        local
  31.  
  32. cog            doortalk        
  33.  
  34. end
  35.  
  36. # ========================================================================================
  37. code
  38.  
  39. startup:
  40.  
  41. player = GetLocalPlayerThing();
  42.  
  43. MoveToFrame(button0, 1, 1.0);
  44. MoveToFrame(door0, 1, 1.0);
  45.  
  46. SetAdjoinFlags(deathAdjoin, 0x2);
  47.  
  48. return;
  49.  
  50. # ........................................................................................
  51. activated:
  52.  
  53. # Code for activating door with nothing or wrong thing.
  54. if (GetSenderRef() == door0)
  55.     {
  56.     #Small cutscene.
  57.     if (MakeMeStop() == -1)
  58.         return;
  59.     DeselectWeaponWait(player);    
  60.     StartCutscene(0);
  61.     PlayMode(player, 60, 1);
  62.     SendMessageEx(doorTalk, user4, player, 0, 0, 0);
  63.     while (global15 == 0)
  64.         {
  65.         #Wait for line to finish...
  66.         Sleep(0.01);
  67.         }
  68.     ClearActorFlags(player, 0x200000);
  69.  
  70.     EndCutscene();   
  71.     }
  72. # Button activation code if it is in and door is up.    
  73. if ((GetSenderRef() == button0) && (GetCurFrame(button0) == 1))
  74.     {
  75.     if (done0 == 1) return;
  76.     done0 = 1;
  77.     
  78.     #Small cutscene.
  79.  
  80.     if (MakeMeStop() == -1)
  81.         return;
  82.     DeselectWeaponWait(player);    
  83.     StartCutscene(0);
  84.     PlayMode(player, 60, 1);
  85.     SendMessageEx(doorTalk, user3, player, 0, 0, 0);
  86.     while (global15 == 0)
  87.         {
  88.         #Wait for line to finish...
  89.         Sleep(0.01);
  90.         }
  91.     ClearActorFlags(player, 0x200000);
  92.  
  93.     done0 = 0;
  94.  
  95.     EndCutScene();
  96.     
  97.     return;
  98.     }
  99. # Button activation code if it is out and door is down.    
  100. if ((GetSenderRef() == button0) && (GetCurFrame(button0) == 0))
  101.     {
  102.     if (done1 == 1) return;
  103.     done1 = 1;
  104.     
  105.     # Prep the indy actor.
  106.     if (MakeMeStop() == -1)
  107.         return;
  108.     DeselectWeaponWait(player);    
  109.     StartCutScene(0);
  110.     
  111.     # Prep indy. 
  112.     CopyPlayerHolsters(player, indy0); 
  113.     ClearThingFlags(indy0, 0x80000);
  114.     SetThingFlags(player, 0x80000);
  115.  
  116.     # Set up camera.
  117.     ResetCameraFOV(0, 0);
  118.     SetCameraLookInterp(2, 0);
  119.     SetCameraPosInterp(2, 0);
  120.     SetCurrentCamera(2);
  121.     SetCameraFocus(2, cam0);
  122.     SetCameraSecondaryFocus(2, cam0_target);
  123.     
  124.     # Activate anim mode.
  125.     PlayMode(indy0, 60, 0);
  126.  
  127.     MoveToFrame(door0, 1, 1.0);
  128.     MoveToFrame(button0, 1, 1.0);
  129.  
  130.     AISetLookThing(indy0, door0);
  131.     }
  132.  
  133. return;
  134.  
  135. # ........................................................................................
  136. arrived:
  137.  
  138. # Once the door is open...
  139. if ((GetSenderRef() == door0) && (GetCurFrame(door0) == 1) && (done1 == 1))
  140.     {
  141.     SendMessageEx(doorTalk, user1, player, 0, 0, 0);
  142.     while (global15 == 0)
  143.         {
  144.         # Wait for line to finish...
  145.         Sleep(0.01);
  146.         }
  147.  
  148.     # Return to normal.
  149.     CopyOrientandPos(indy0, player);
  150.     
  151.     v_camspot = VectorAdd(VectorTransformToOrient(player, '0.2 -0.02 0.07'), GetThingPos(player));    
  152.     SetCameraPosition(1, v_camspot);
  153.     
  154.     SetCurrentCamera(1);
  155.     ResetCameraFOV(0, 0);
  156.     SetThingFlags(indy0, 0x80000);
  157.     ClearThingFlags(player, 0x80000);
  158.     
  159.     EndCutScene();
  160.     ClearActorFlags(player, 0x200000);
  161.     }
  162. if ((GetSenderRef() == door0) && (GetCurFrame(door0) == 0))
  163.     {
  164.     global11 = 1;
  165.     }
  166.  
  167. return;
  168.  
  169. # ........................................................................................
  170. user0:
  171.  
  172. # Set up camera.
  173. ResetCameraFOV(0, 0);
  174. SetCameraLookInterp(2, 0);
  175. SetCameraPosInterp(2, 0);
  176. SetCameraFocus(2, cam0);
  177. SetCameraSecondaryFocus(2, cam0_target);
  178.  
  179. MoveToFrame(door0, 0, 1.0);
  180. MoveToFrame(button0, 0, 1.0);
  181. ClearAdjoinFlags(deathAdjoin, 0x2);
  182.  
  183. return;
  184.  
  185. # ........................................................................................
  186. end
  187.  
  188.